#include "widget.h"
#include "ui_widget.h"
#include"mylabel.h"
#include<QLineEdit>
#include<QObject>
#include<QLabel>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
    ,count(0)
{
    ui->setupUi(this);
    MyLabel* label = new MyLabel(this);
    label->setText ("hello world!!!");
    QLineEdit* edit = new QLineEdit(this);
    edit->setText("hello QT!!!");
    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::handleClick);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClick()
{/*
    if(count++ == 0)
        ui->pushButton->setText("hello qt!!!");
    else if(count == 5)
        ui->pushButton->setText("滚");*/
    if(ui->pushButton->text()==QString("hello qt!!!"))
    {
        ui->pushButton->setText("HELLO QT!!!");
    }
    else
        ui->pushButton->setText("hello qt!!!");
}
